<?php
namespace app\validate;
use share\validate\SceneValidate;

class UserLogValidate extends SceneValidate{

    /**
     * 通用规则
     */
    protected $rule = [
        'id' => 'require|integer',
        'level' => 'require|integer',
        'name' => 'require|length:2,16',
        'account' => 'length:2,32',
        'keyword' => 'length:2,32',
        'module' => 'length:2,32',
        'action' => 'length:2,32',
    ];    

    /**
     * 自定义场景的规则
     */
    protected $sceneRules = [
        'set' =>[
            'id' => 'require|integer',
            'level' => 'integer',
            'account' => 'length:2,16',
            'password' => 'length:6,20',
            'vendor' => 'length:2,20',
        ],
    ];

    protected $scene = [
        'list' => ['account','keyword','module','action'],    
    ];
}
